package com.hezhiqin.mybatis;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @program: homeWork
 * @description:
 * @author: hezhiqin
 * @create: 2019-11-29 18:49
 */
public class HZQMapperProxy implements InvocationHandler {

    HZQSqlSession hzqSqlSession;

    public HZQMapperProxy(HZQSqlSession hzqSqlSession) {
        this.hzqSqlSession = hzqSqlSession;
    }

    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        String statmentId = method.getDeclaringClass().getName()+"."+method.getName();

        return hzqSqlSession.selectOne(statmentId,args[0]);
    }



}
